#include<bits/stdc++.h>

using namespace std;

bool ok(char s[]) {
    int n = strlen(s);
    if (n == 0)return false;
    if (s[0] != '_' && !isalpha(s[0]))return false;
    for (int i = 1; i < n; i++) {
        if (s[i] != '_' && !isalnum(s[i]))return false;
    }
    return true;
}

int main() {
    freopen("F.in", "r", stdin);
    char s[200];
    int T;
    cin >> T;
    fgets(s, 200 - 1, stdin);//gets(s);
    while (T--) {
        fgets(s, 200 - 1, stdin);
        if (s[strlen(s) - 1] == '\n')
            s[strlen(s) - 1] = 0;
        cout << "strlen(s)=" << strlen(s) << endl;
        //gets(s);
        if (ok(s)) {
            cout << "yes" << endl;
        } else {
            cout << "no" << endl;
        }
    }
    return 0;
}
